package com.bac.rentmap.web.controller.ad.batch.proccess;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.bac.rentmap.ad.batch.proccess.BatchProccessor;

public class BatchProccessingController extends AbstractController {
	private BatchProccessor batchProccessor;

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		int count = batchProccessor.proccess();
		response.getWriter().print("proccessed " + count + " ads");
		return null;
	}

	public void setBatchProccessor(BatchProccessor batchProccessor) {
		this.batchProccessor = batchProccessor;
	}
}
